Function DofArray(arr) As Integer
    On Error Resume Next
    '判断是否数组
    If Not IsArray(arr) Then
        DofArray = -1
        Exit Function
    End If
    '利用出错来判断
    For i = 1 To 60
        aa = UBound(arr, i)
        If Err.Number <> 0 Then
            DofArray = i - 1
            Exit Function
        End If
    Next
End Function
